#include <iostream>

using namespace std;

void he(int * nums, int target, int l);

int main(void)
{
	int nums[4] = {2, 7, 11, 15};
	int target = 9;

	he(nums, target, 4);

	return 0;
}

void he(int * nums, int target, int l)
{
	int i, j;
	int sum;
	for(i = 0; i < l - 1; i ++)
	{
		for(j = i + 1; j < l; j ++)
		{
			sum = nums[i] + nums[j];
			if(sum == target)
				cout << "[" << i << "," << j << "]" << endl;
		}
	}
}
